import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Bottom from '@/components/bottom.vue'
import 'vant/lib/index.css';
import Vant from 'vant';
import { ShareSheet } from 'vant';
import { Popover } from 'vant';
import Router from 'vue-router'
import Bottomflag from '@/components/homecomp/bottomflag'
// 学习里面日期
import { Calendar } from 'vant';
Vue.use(Calendar);

Vue.use(Popover);
Vue.use(ShareSheet);
Vue.use(Vant);

require("./mock/index.js")

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
Vue.config.productionTip = false;
Vue.filter("omit", (val) => {
    // 大于20个就保留20位 并且在后面加...
    if (!val) {
        return "";
    }
    if (val.length >= 20) {
        return val.substr(0, 20) + "...";
    } else {
        return val;
    }
})
Vue.component("Bottom", Bottom)
Vue.component("Bottomflag", Bottomflag)

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')